#!/bin/sh

uci -q batch <<-EOF >/dev/null
    delete ucitrack.@wifidog-ng[-1]
    add ucitrack wifidog-ng
    set ucitrack.@wifidog-ng[-1].init=wifidog-ng
    commit ucitrack
EOF

chmod +x /etc/init.d/wifidog-ng

/etc/init.d/wifidog-ng stop

yes|cp /tmp/wifidog-ng.init /etc/init.d/wifidog-ng

chmod +x /etc/init.d/wifidog-ng

/etc/init.d/wifidog-ng enable
/etc/init.d/wifidog-ng start

rm -f /tmp/luci-indexcache
exit 0